package com.bw.service.imp;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bw.bean.Cate;
import com.bw.bean.Movie;
import com.bw.bean.MovieCate;
import com.bw.mapper.MovieMapper;
import com.bw.service.MovieService;
@Service
public class MovieServiceImp implements MovieService{
	@Resource
	private MovieMapper dao;
	@Override
	public List<Map<String, Object>> findall(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return dao.findall(map);
	}
	@Override
	public List<Cate> findcate() {
		// TODO Auto-generated method stub
		return dao.findcate();
	}
	@Override
	public int add(Movie m,List<Integer> list) {
		
		
		
	int n=dao.add(m);
	System.out.println(m.getMid());
	Map<String, Object> map=new HashMap<String, Object>();
	if(n>0) {
		map.put("list", list);
		map.put("mid", m.getMid());
		
	}
	int i=dao.addmoviecate(map);


		return n;
	}
	


}
